define( [
  'jquery',
  'bigwe_utils',
  'artTemplate',
  'constants'
], function( $, bu, art, c ) {

  art.helper( 'encodeHtml', function( str ) {
    return bu.encodeHtml( str || '' )
  } );

  var exportParam = {

    imgListComponents: function( arrayList, isnotTimthumb, data ) {
      var dataStr = '';
      for ( var i in data ) {
        dataStr += ' ' + i + '=' + data[ i ];
      }

      // 给内容添加标记 循环计算视野内的
      var html = '{{each list as item i}}<div ' + dataStr + ' data-cd="{{ item.image_id }}" title="{{ item.title | encodeHtml }}" class="img_item_wrap"><div class="img_filter_wrap">' +
        '<div class="btn_wrapper">' +
        '<button type="button" title="用于正文" class="btn btn-default inserttype js_insertcontent">用于正文</button>' +
        '<button type="button" class="btn btn-default inserttype js_insertcover" title="用于封面">用于封面</button>' +
        '<button type="button" class="btn btn-default inserttype js_insertbackgroundimg hide" title="用于背景">用于背景</button>' +
        '</div>' +
        '</div><img class="img_item" src="' + ( isnotTimthumb ? '' : ( c.surpportHostName + '/timthumb.php?w=297&h=206&src=' ) ) + '{{item.img_url}}" editor_url="{{item.img_url}}" class="img_item" onerror="$(this).parent().remove();"/><div class="glyphicon glyphicon-ok delete_choose"></div></div>{{/each}}';

      return art.render( html, {
        list: arrayList
      } );
    }
  };

  return exportParam;
} );
